<?php

namespace App\Models;

use App\Common\Status;
use Illuminate\Database\Eloquent\Model;

class Note extends Model
{
    protected $table      = 'recruit_notes';
    public    $timestamps = false;

    public function work_exp()
    {
        # App\Models\WorkExp for
        # Note loc
        return $this->hasMany('App\Models\WorkExp', "mobile", "mobile")
            ->where([
                'status'     => Status::REGULAR,
                'is_deleted' => Status::NOT_DELETE
            ])->orderBy("work_date_st","desc");
    }

    public function educational_back()
    {
        return $this->hasMany('App\Models\EducationalBack', "mobile", "mobile")->where([
            'status'     => Status::REGULAR,
            'is_deleted' => Status::NOT_DELETE
        ])->orderBy("st_date_st","desc");
    }

    public function notes_intention()
    {
        return $this->hasMany('App\Models\NotesIntention', "mobile", "mobile")->where([
            'status'     => Status::REGULAR,
            'is_deleted' => Status::NOT_DELETE
        ]);
    }
}

